package com.ideal.gpt.ability.docqa.caller;

import com.alibaba.fastjson.JSONObject;
import com.lzwork.gpt.utility.caller.GptCallResult;
import com.lzwork.gpt.utility.common.ParserCaller;

/**
 * @author LiZheng
 * @date 2023年9月20日 下午3:43:29
 */

public class DocQaCaller extends ParserCaller
{
	public DocQaCaller(String serverUrl)
	{
		super(serverUrl, false);
	}

	protected final static String parseApi = "docqa";
	protected final static String jobApi = "job";

	public GptCallResult callParse(String content, int type, int num, String desc, boolean dolog)
	{
		JSONObject param = new JSONObject();
		param.put("content", content);
		param.put("num", num);
		param.put("type", type);
		param.put("desc", desc);
		param.put("dolog", dolog);

		return call(url + parseApi, param);
	}

	public GptCallResult callJob(String job, String content, boolean format, String desc, boolean dolog)
	{
		JSONObject param = new JSONObject();
		param.put("type", job);
		param.put("content", content);
		param.put("desc", desc);
		param.put("format", format);
		param.put("dolog", dolog);

		return call(url + jobApi, param);
	}
}
